target = libmonitor.a
srcs = shm.cpp monitor.cpp 
libs = 
subdirs= 
INCLUDE= -I./ -I../log/include/
#LIBRARY=-pthread -ltcmalloc_minimal
CPPFLAGS+=-g -O2 -std=c++11 -D_REENTRANT -D_GNU_SOURCE -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
all : $(target)


objs=$(patsubst %.cpp, %.o, $(srcs))

all : $(target)

$(target) : $(objs) 
	for dir in $(subdirs); do make -C $(dir) ; done
	ar cr $(target) $^ $(libs)

%.o : %.cpp
	g++ $(INCLUDE) $(CPPFLAGS) $< -c -o $@

.PHONY : clean
clean:
	rm -f $(objs)
	rm -f $(target)
